<?php
namespace Modules\Region\Controllers;

use Core\Mvc\Controller;
use Modules\Region\Entity\Block;

class IndexController extends Controller
{

    public function indexAction($theme, $region, $block)
    {
        $entity = $this->entityManager->get('block', ['theme' => $theme, 'region' => $region, 'block' => $block]);
        if (!$entity) {
            self::$variables = [
                '#templates' => 'json',
                'data' => [
                    'state' => false
                ]
            ];
        } else {
            self::$variables = $entity->render(true);
            //throw new \Exception(print_r(self::$variables,true));
        }
        //$this->config->printCode(self::$variables);
    }
}
